<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ui_usertask.aspx.cs" Inherits="Private_Config_Workflow_ui_usertask" %>
<%@ Register TagPrefix="Flux" Namespace="Deepcode.Flux.Core.UI.Controls" Assembly="Deepcode.Flux.Core" %>
<%@ Register TagPrefix="loc" TagName="Timescale" Src="ctrl_Timescale.ascx" %>

<html>
<head runat="server">
	<link href="../../../Asset/Style/GeneralStyle.css" rel="stylesheet" type="text/css" />
	<link href="./localstyle.css" rel="stylesheet" type="text/css" />
	<script language="javascript">
	function SelectNone( listID )
	{
		var list = document.getElementById( listID );
		list.selectedIndex = -1;
	}
	function ConfirmDelete()
	{
		return confirm("Are you sure you wish to delete this exit path");
	}
	</script>
</head>
<body class="nopad">
<form id="form1" runat="server">
<Flux:HostTable runat="server">

<Flux:Section runat="server">
<Flux:ShadePadBox runat="server" CssClass="infoarea">
	<asp:Label runat="server" ID="labHandler" CssClass="info" /><br/>
	<asp:Label runat="server" ID="labDefinition" CssClass="info" /><br/>
	<asp:Label runat="server" ID="labProcess" CssClass="info" /><br/>
	<asp:Label runat="server" ID="labTasking" CssClass="info" />
</Flux:ShadePadBox>
</Flux:Section>

<Flux:ValidationSummarySection runat="server" HeaderText="Please correct the following errors"/>

<Flux:CollapseSection runat="server" Title="Edit User Tasking">
<Flux:ShadePadBox runat="server">

	<table cellspacing="0" cellpadding="5" border="0" width="100%">
	<tr><td nowrap="nowrap">
			Task: <%=Required%>
		</td>
		<td width="100%"><asp:TextBox Runat="server" ID="TaskCaption" Width="300px" style="width:300px" MaxLength="500"/></td>
	</tr>

	<tr><td valign="top" nowrap="nowrap">
		Task operators:<br/>
		<a href="javascript:SelectNone('CSV_OperatorID')">[none]</a>
		</td>
		<td valign="top">
		<asp:ListBox runat="server" ID="CSV_OperatorID" Width="100%" Height="100px" SelectionMode="Multiple"/>
		</td>
	</tr>
	<tr><td valign="top" nowrap="nowrap">
		Task groups:<br/>
		<a href="javascript:SelectNone('CSV_GroupID')">[none]</a>
		</td>
		<td valign="top">
		<asp:ListBox runat="server" ID="CSV_GroupID" Width="100%" Height="100px" SelectionMode="Multiple"/>
		</td>
	</tr>
	<tr><td valign="top" nowrap="nowrap">
		Task special:<br/>
		<a href="javascript:SelectNone('GetUserMethod')">[none]</a>
		</td>
		<td valign="top">
		<asp:ListBox runat="server" ID="GetUserMethod" Width="100%" Height="100px" SelectionMode="Single"/>
		</td>
	</tr>
	
	<tr><td nowrap="nowrap">Delay task from process start:</td>
		<td><loc:Timescale runat="server" ID="ActivateTask"/></td>
		</tr>
	<tr><td nowrap="nowrap">Task should be completed within:</td>
		<td><loc:Timescale runat="server" ID="DeadlineTask"/></td>
		</tr>
	</table>
</Flux:ShadePadBox>
<Flux:PadBox CssClass="Pad5Button" runat="server">
	<asp:Button runat="server" ID="btnSave" Text="Update" OnClick="btnSave_Click"/>&nbsp;&nbsp;&nbsp;
</Flux:PadBox>
</Flux:CollapseSection>

<Flux:CollapseSection runat="server" Title="Exit paths">
<Flux:StandardDataGrid runat="server" ID="datagrid" DataKeyField="PK_ID" ClickRowSelect="False" AllowPaging="false">
	<Columns>
		<asp:BoundColumn DataField="Caption" ReadOnly="True" HeaderText="Exit"></asp:BoundColumn>
		<asp:BoundColumn DataField="CalcUITaskMethod" ReadOnly="True" HeaderText="UI"></asp:BoundColumn>
		<asp:BoundColumn DataField="CalcCSV_AllowedGroups" ReadOnly="True" HeaderText="Groups"></asp:BoundColumn>
		<asp:TemplateColumn HeaderText="Options">
		<ItemTemplate>
			<asp:LinkButton ID="btnDelete" Runat="server" CssClass="DangerLink" CommandName="ItemDelete" CausesValidation="false">[Delete]</asp:LinkButton>
			<asp:LinkButton ID="btnEdit" Runat="server" CssClass="SafeLink" CommandName="ItemEdit" CausesValidation="false">[Edit]</asp:LinkButton>
		</ItemTemplate>
		</asp:TemplateColumn>
	</Columns>
</Flux:StandardDataGrid>
<Flux:PadBox CssClass="Pad5Button" runat="server">
	<asp:Button runat="server" ID="btnAddExitPath" Text="Add Exit Path" OnClick="btnAddExit_Click"/>&nbsp;&nbsp;&nbsp;
</Flux:PadBox>
</Flux:CollapseSection>

<Flux:Section runat="server">
<Flux:PadBox CssClass="Pad5Button" runat="server">
	<asp:Button runat="server" ID="btnCancel" Text="Return to Process" OnClick="btnCancel_Click" CausesValidation="False"/>
</Flux:PadBox>
</Flux:Section>

<!-- Validators -->
<asp:RequiredFieldValidator Runat="server" ControlToValidate="TaskCaption" ErrorMessage="You must specify the name of this task" Display="None"/>

</Flux:HostTable>
</form>
</body>
</html>
